/**
 * Created by user on 2018/5/21.
 */
const PREFIX = 'material_'
const MaterialActionType = {
  init_swiper: PREFIX + 'init_images',
  change_index: PREFIX + 'change_index',
  change_video_mask: PREFIX + 'change_video_mask',
  toggle_material_show: PREFIX + 'toggle_material_show',
  toggle_loading: PREFIX + 'toggle_loading'
}
const toggleLoading = (loading) => {
  return {
    type: MaterialActionType.toggle_loading,
    loading: loading
  }
}
const toggleMaterialShow = (show) => {
  return {
    type: MaterialActionType.toggle_material_show,
    show: show
  }
}

const toggleVideoMask = (show)=> {
  return {
    type: MaterialActionType.change_video_mask,
    show: show
  }
}
const initSwiper = (images, index) => {
  return {
    type: MaterialActionType.init_swiper,
    images: images,
    index: index
  }
}
const changeIndex = (index) => {
  return {
    type: MaterialActionType.change_index,
    index: index
  }
}

module.exports = {
  MaterialActionType,
  initSwiper,
  changeIndex,
  toggleVideoMask,
  toggleMaterialShow,
  toggleLoading
}
